contract FunctionOverloadingContract {
int value;
constructor(int newValue) {
value = newValue;
}
}
A. No issue at all. Constructor can have parameters in Solidity
B. Would throw a compilation error as only constructors with no
parameters are allowed in Solidity
C. Would cause issue during the run as only the constructors with
no parameters are allowed in Solidity
D. None of these
Q23: What is the issue with the following code?
// SPDX-License-Identifier: SOME IDENTIFIER
pragma solidity ^0.8.10;
contract FunctionOverloadingContract {
int value;
constructor(){
value = 1;
}
constructor(int newValue) {
value = newValue;
}
}
A. No issue at all. Constructor overloading is allowed in Solidity
B. Would throw a compilation error as the variable is needed to
be declared private
C. Would cause issue during the runas the variable is needed to
be declared private